<?php
/*
$JA#COPYRIGHT$
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

// Include the syndicate functions only once
require_once (dirname(__FILE__).DS.'helper.php');
jimport( 'joomla.application.component.model' );
require_once JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'asset'.DS.'jaconstants.php';
require_once JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'asset'.DS.'japermissions.php';
require_once(JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'helper'.DS.'jafunctions.class.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'models'.DS.'jaresumes.php');
global $mainframe,$jbconfig;

component_configs();

if(!defined('JAJOBBOARD_GLOBAL_CSS')){
	 global $mainframe;
	 if(file_exists(JPATH_BASE.DS.'templates/'.$mainframe->getTemplate().'/css/ja.jobboard.css')){
	 	JHTML::stylesheet('ja.jobboard.css', 'templates/'.$mainframe->getTemplate().'/css/');
	 }
	 else{
	 	JHTML::stylesheet('ja.jobboard.css', 'components/'. 'com_jajobboard' .'/css/');
	 }    	 	 	 
	 JHTML::script('ja.jobboard.js', 'components/com_jajobboard/js/');
	 JHTML::script('joomla.javascript.js', 'includes/js/');
	 
	 define('JAJOBBOARD_GLOBAL_CSS', 1);
} 

/* Requirement Cache*/
require_once(JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'asset'.DS.'jacache'.DS.'jacache.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'asset'.DS.'jacache'.DS.'jajob.inc.php');

$cache = new JA_Cache($jbconfig['cache']->get('cache_base', JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'cache'),                       $jbconfig['cache']->get('cache_time', 5), $jbconfig['cache']->get('caching', true));
$cache_id = md5('mod_jalatestresumes');
$cache_group = 'jaresumes';
if($cache->check_cache($cache_id, $cache_group)) return ;
else $oldlen = strlen(ob_get_contents());
/* End cache */

$model = new JobBoardModelJAResumes();

$list = modLatestResumesHelper::getList($model,$params);
require(JModuleHelper::getLayoutPath('mod_jalatest_resumes'));

/* Set cache */
$maincontent = substr(ob_get_contents(), $oldlen);
if($maincontent){
	$cache->_cache->store($maincontent, $cache_id, $cache_group);		
}
?>